package com.anyisn.anyflickr.shell.controller
{
	
	import com.anyisn.anyflickr.common.ApplicationConstants;
	import com.anyisn.anyflickr.shell.model.AuthProxy;
	import com.anyisn.anyflickr.shell.model.ListPhotosProxy;
	import com.anyisn.anyflickr.shell.model.PhotoProxy;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	public class LogoutCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void {
			var authP:AuthProxy = facade.retrieveProxy(AuthProxy.NAME) as AuthProxy;
			var photoP:PhotoProxy = facade.retrieveProxy(PhotoProxy.NAME) as PhotoProxy;
			var photosP:ListPhotosProxy = facade.retrieveProxy(ListPhotosProxy.NAME) as ListPhotosProxy;
			
			authP.processLogout();
			photoP.logout();
			photosP.logout();
			
			var photoMenu:Array = ApplicationConstants.photoMenu;
			photoMenu[0].enabled = false;
		}
	}
}